<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->

<title>tigetflag</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<xref type="10" name="tigetflag"></xref>
<h4><a name = "tag_002_001_061">&nbsp;</a>NAME</h4><blockquote>
tigetflag, tigetnum, tigetstr, tparm - retrieve capabilities from the
<b>terminfo</b> database
</blockquote><h4><a name = "tag_002_001_062">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="term.h.html">term.h</a>&gt;

int tigetflag(char *<i>capname</i>);

int tigetnum(char *<i>capname</i>);

char *tigetstr(char *<i>capname</i>);

char *tparm(char *<i>cap</i>, long <i>p1</i>, long <i>p2</i>, long <i>p3</i>, long <i>p4</i>,
            long <i>p5</i>, long <i>p6</i>, long <i>p7</i>, long <i>p8</i>, long <i>p9</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_002_001_063">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>tigetflag()</i>,
<i>tigetnum()</i>,
and
<i>tigetstr()</i>
functions obtain boolean, numeric and string capabilities, respectively, from
the selected record of the <b>terminfo</b> database.
For each capability, the value to use as <i>capname</i> appears in the
<b>Capname</b>
column in the table in
<xref href=caplist><a href="terminfo.html#tag_002_001_003">
Defined Capabilities
</a></xref>.
<p>
The
<i><a href="tparm.html">tparm()</a></i>
function takes as
<i>cap</i>
a string capability.  If
<i>cap</i>
is parameterised (as described in
<xref href=paramstring></xref>),
<i><a href="tparm.html">tparm()</a></i>
resolves the parameterisation.  If the parameterised string refers to
parameters %p1<i> through %p9</i>, then
<i><a href="tparm.html">tparm()</a></i>
substitutes the values of <i>p1</i> through <i>p9</i>, respectively.
</blockquote><h4><a name = "tag_002_001_064">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion,
<i>tigetflag()</i>,
<i>tigetnum()</i>
and
<i>tigetstr()</i>
return the specified capability.  The
<i>tigetflag()</i>
function returns -1 if <i>capname</i> is not a boolean capability.  The
<i>tigetnum()</i>
function returns -2 if <i>capname</i> is not a numeric capability.  The
<i>tigetstr()</i>
function returns (<b>char *</b>)-1 if <i>capname</i> is not a string
capability.
<p>
Upon successful completion,
<i><a href="tparm.html">tparm()</a></i>
returns <i>str</i> with parameterisation resolved.  Otherwise, it returns a
null pointer.
</blockquote><h4><a name = "tag_002_001_065">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_002_001_066">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
For parameterised
string capabilities, the application should pass the return value from
<i>tigetstr()</i>
to
<i><a href="tparm.html">tparm()</a></i>,
as described above.
<p>
Applications intending to send terminal capabilities directly to the terminal
(which should only be done using
<i><a href="tputs.html">tputs()</a></i>
or
<i><a href="putp.html">putp()</a></i>)
instead of using Curses, normally should obey the following rules:
<ul>
<p>
<li>
Call
<i><a href="reset_shell_mode.html">reset_shell_mode()</a></i>
to restore the display modes before exiting.
<p>
<li>
If using cursor addressing, output <b>enter_ca_mode</b> upon
startup and output <b>exit_ca_mode</b> before exiting.
<p>
<li>
If using shell escapes, output
<b>exit_ca_mode</b>
and call
<i><a href="reset_shell_mode.html">reset_shell_mode()</a></i>
before calling the shell; call
<i><a href="reset_prog_mode.html">reset_prog_mode()</a></i>
and output
<i>enter_ca_mode</i>
after returning from the shell.
<p>
</ul>
<p>
All parameterised terminal capabilities defined in this document
can be passed to
<i><a href="tparm.html">tparm()</a></i>.
Some implementations create their own capabilities, create
capabilities for non-terminal devices, and redefine the capabilities in this
document.  These practices are non-conforming because it may be that
<i><a href="tparm.html">tparm()</a></i>
cannot parse these user-defined strings.
</blockquote><h4><a name = "tag_002_001_067">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="def_prog_mode.html">def_prog_mode()</a></i>,
<i><a href="tgetent.html">tgetent()</a></i>,
<i><a href="putp.html">putp()</a></i>,
<i><a href="term.h.html">&lt;term.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
